/**
* \brief 
* \author pengcheng (pengcheng@yslrpch@126.com)
* \date 
* \attention CopyrightÃ‚Â©ADC Technology(tianjin)Co.Ltd
* \attention Refer to COPYRIGHT.txt for complete terms of copyright notice
*/


#ifndef SGM_PATH_AGGREGATION_HPP
#define SGM_PATH_AGGREGATION_HPP

#include <stereo_vision/sgm.h>
#include "stereo_vision/impl/device_buffer.hpp"
#include "stereo_vision/impl/types.hpp"

namespace adc {

template <size_t MAX_DISPARITY>
class PathAggregation {

private:
	static const unsigned int MAX_NUM_PATHS = 8;

	DeviceBuffer<cost_type> m_cost_buffer;
	cudaStream_t m_streams[MAX_NUM_PATHS];
	cudaEvent_t m_events[MAX_NUM_PATHS];
	
public:
	PathAggregation();
	~PathAggregation();

	const cost_type *get_output() const {
		return m_cost_buffer.data();
	}

	void enqueue(
		const feature_type *left,
		const feature_type *right,
		int width,
		int height,
		PathType path_type,
		unsigned int p1,
		unsigned int p2,
		int min_disp,
		cudaStream_t stream);

};

}

#endif
